package sdk

// 履约单发货请求
type OrderShipRequest struct {
	*BaseRequest
	ConsignCode   string           `json:"consignCode"`   // 履约单号: 必填
	Type          int              `json:"type"`          // 是否重新发货: 可选, 0=否, 1=是, 默认值=0
	LogisticsList *[]LogisticsItem `json:"logisticsList"` // 订单对应物流信息集合
}

//
type LogisticsItem struct {
	LogisticsChannel string `json:"logisticsChannel"` // 物流公司
	LogisticsNumber  string `json:"logisticsNumber"`  // 物流单号
}

//
func (request *OrderShipRequest) GetMethod() (method string) {
	return "/order/ship"
}

//
func CreateOrderShipRequest() (request *OrderShipRequest) {
	request = &OrderShipRequest{
		BaseRequest: &BaseRequest{},
	}
	return
}

// 履约单发货响应
type OrderShipResponse struct {
	*BaseResponse
}

// 履约单发货
func (client *Client) OrderShip(request *OrderShipRequest) (response *OrderShipResponse, err error) {
	response = &OrderShipResponse{
		BaseResponse: &BaseResponse{},
	}
	err = client.DoAction(request, response)
	return
}
